package com.xyzh.application.config.security;

import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;
import java.security.MessageDigest;

public class Md5Encode {

    public static String  encode(String password)  {
        try {

            MessageDigest md = MessageDigest.getInstance("SHA");
            md.update(password.getBytes());
            String str = new BigInteger(md.digest()).toString(32);
            return str;
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            return "";
        }
    }

    public static void main(String[] args) {
        System.out.println(encode("dzt@888"));
    }
}
